package tom.change.Reflect.获取所有方法;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Test {

	public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, NoSuchMethodException, SecurityException{
		Class<?> clazz=Class.forName("tom.change.Reflect.获取父类和所有接口.Dog");
		Method[] methods = clazz.getMethods();
		for (int i = 0; i < methods.length; i++) {
			System.out.println(methods[i]);
		}
		//调用method方法
		Method method = clazz.getMethod("fuck",String.class);
		method.invoke(clazz.newInstance(),"zxh");
		
	}
}
